<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //1、拼接字符串
        //concat、substr、slice、subString
        // var str = 'andey'
        // console.log(str.concat('hello'));
        //2、截取substr("截取的起始位置"，""截取几个字符")
        // var str = 'hellloworld'
        // console.log(str.substr(2,2));//从第二个位置截取两个字符串

        //3、替换字符串 replace
        //替换opouyyhjikouool字符串中所有o为*
        // var str = 'opouyyhjikouool'
        // while(str.indexOf('o') !== -1){
        //     str = str.replace('o','*')
        // }
        // console.log(str);

        //字符串转化为数组 split
        // var str ='red,hello,blue';
        // console.log(str.split(','));


        
    </script>
</body>
</html>